package com.th.cash.th2.product

import com.th.basemodel.base.BaseRepository
import com.th.basemodel.bean.OkResult
import com.th.basemodel.ext.extRequestHttp
import com.th.cash.http.AppRetrofit
import okhttp3.MultipartBody

class ProductRepository: BaseRepository() {
    suspend fun getProductDetail(request: ProductDetailRequest): OkResult<ProductDetailResponse> {
        return extRequestHttp {
            AppRetrofit.productService.getProductDetail(request)
        }
    }

    suspend fun initBaseInfo(request: BaseInfoRequest): OkResult<BaseInfoResponse> {
        return extRequestHttp {
            AppRetrofit.productService.initBaseInfo(request)
        }
    }

    suspend fun saveBaseInfo(request: MutableMap<String, Any?>): OkResult<VerifySuccessResponse> {
        return extRequestHttp {
            AppRetrofit.productService.saveBaseInfo(request)
        }
    }

    suspend fun initContactInfo(request: ContactInfoRequest): OkResult<ContactInfoResponse> {
        return extRequestHttp {
            AppRetrofit.productService.initContactInfo(request)
        }
    }

    suspend fun saveContactInfo(request: MutableMap<String, Any?>): OkResult<VerifySuccessResponse> {
        return extRequestHttp {
            AppRetrofit.productService.saveContactInfo(request)
        }
    }

    suspend fun initBankInfo(request: BankInfoRequest): OkResult<BankInfoResponse> {
        return extRequestHttp {
            AppRetrofit.productService.initBankInfo(request)
        }
    }

    suspend fun saveBankInfo(request: MutableMap<String, Any?>): OkResult<VerifySuccessResponse> {
        return extRequestHttp {
            AppRetrofit.productService.saveBankInfo(request)
        }
    }

    suspend fun initIdCard(request: IdCardRequest): OkResult<IdCardResponse> {
        return extRequestHttp {
            AppRetrofit.productService.initIdCard(request)
        }
    }

    suspend fun saveIdCard(request: MutableMap<String, Any?>): OkResult<VerifySuccessResponse> {
        return extRequestHttp {
            AppRetrofit.productService.saveIdCard(request)
        }
    }

    suspend fun uploadIdCard(request: MultipartBody): OkResult<UploadIdCardResponse> {
        return extRequestHttp {
            AppRetrofit.productService.uploadIdCard(request)
        }
    }

    suspend fun getOrderUrl(request: OrderUrlRequest): OkResult<OrderUrlResponse> {
        return extRequestHttp {
            AppRetrofit.productService.getOrderUrl(request)
        }
    }
}